import { defineConfig } from "vite"
import vue from "@vitejs/plugin-vue"
import path from "path"

// 导入 elementUI，参考：http://element-plus.org/zh-CN/guide/quickstart.htmlnnpm
import AutoImport from "unplugin-auto-import/vite"
import Components from "unplugin-vue-components/vite"
import { ElementPlusResolver } from "unplugin-vue-components/resolvers"

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
      vue(),
      // 导入 elementUI
      AutoImport({
        resolvers: [ElementPlusResolver()],
      }),
      Components({
        resolvers: [ElementPlusResolver()],
      }),
  ],
  resolve: {
    //配置路径别名
    alias: { 
      '@': path.resolve('src')
    }
  }
})
